#include "ebu/list/ptp/v2/message_header.h"

//------------------------------------------------------------------------------
namespace ebu_list::ptp::v1::test
{
    namespace sync_1
    {
        // from ptpv1.pcap
        constexpr auto data = to_byte_array(
            0x00, 0x01, 0x00, 0x01, 0x5f, 0x44, 0x46, 0x4c, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
            0x00, 0x00, 0x01, 0x01, 0x00, 0x30, 0x05, 0x1d, 0x1e, 0x27, 0x00, 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x08,
            0x00, 0x00, 0x00, 0x00, 0x45, 0x5b, 0x0a, 0x38, 0x0e, 0xb9, 0x26, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
            0x00, 0x30, 0x05, 0x1d, 0x1e, 0x27, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x04, 0x44, 0x46, 0x4c, 0x54,
            0x00, 0x00, 0xf0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xf0, 0x60, 0x00, 0x00,
            0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x46, 0x4c, 0x54, 0x00, 0x01, 0x00, 0x30, 0x05, 0x1d, 0x1e, 0x27,
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
    } // namespace sync_1
} // namespace ebu_list::ptp::v1::test
//------------------------------------------------------------------------------
namespace ebu_list::ptp::v2::test
{
    using ebu_list::to_byte_array;
    using ebu_list::ptp::ts80;

    //------------------------------------------------------------------------------
    namespace sync_1
    {
        // from ptpv2.pcap
        constexpr auto sequence_id      = 1085;
        constexpr auto clock_identity   = to_byte_array(0x01, 0x80, 0x63, 0xff, 0xff, 0x00, 0x09, 0xba);
        constexpr auto origin_timestamp = ts80(1169232201, 775045731);
        constexpr auto data =
            to_byte_array(0x00, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x63, 0xff, 0xff, 0x00, 0x09, 0xba, 0x00, 0x02,
                          0x04, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x45, 0xb1, 0x11, 0x49, 0x2e, 0x32, 0x42, 0x63);
    } // namespace sync_1

    namespace sync_2
    {
        // from ptp_at_clock.pcap
        constexpr auto sequence_id      = 28276;
        constexpr auto origin_timestamp = ts80(1445454165, 127078000);
        constexpr auto data =
            to_byte_array(0x00, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x7f, 0xff, 0xfe, 0x80, 0x02, 0x4a, 0x00, 0x01,
                          0x6e, 0x74, 0x00, 0x00, 0x00, 0x00, 0x56, 0x27, 0xe1, 0x55, 0x07, 0x93, 0x0e, 0x70);
    } // namespace sync_2

    namespace sync_3
    {
        // from ptpv2.pcap, but with origin ts changed to use msb
        constexpr auto sequence_id      = 1085;
        constexpr auto origin_timestamp = ts80(0xa43245b11149, 0x2e324263);
        constexpr auto data =
            to_byte_array(0x00, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x63, 0xff, 0xff, 0x00, 0x09, 0xba, 0x00, 0x02,
                          0x04, 0x3d, 0x00, 0x00, 0xA4, 0x32, 0x45, 0xb1, 0x11, 0x49, 0x2e, 0x32, 0x42, 0x63);
    } // namespace sync_3

    //------------------------------------------------------------------------------
    namespace follow_up_1
    {
        // from PTP_clock.pcap
        constexpr auto sequence_id              = 46019;
        constexpr auto precise_origin_timestamp = ts80(1486566164, 970495934);
        constexpr auto data =
            to_byte_array(0x08, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x99, 0x3a, 0xff, 0xff, 0x26, 0x7e, 0x2b, 0x00, 0x14,
                          0xb3, 0xc3, 0x02, 0xfd, 0x00, 0x00, 0x58, 0x9b, 0x33, 0x14, 0x39, 0xd8, 0x97, 0xbe);
    } // namespace follow_up_1

    namespace follow_up_2
    {
        // from PTP_clock.pcap
        constexpr auto sequence_id              = 46019;
        constexpr auto precise_origin_timestamp = ts80(1486566165, 95540911);
        constexpr auto data =
            to_byte_array(0x08, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x99, 0x3a, 0xff, 0xff, 0x26, 0x7e, 0x2b, 0x00, 0x14,
                          0xb3, 0xc4, 0x02, 0xfd, 0x00, 0x00, 0x58, 0x9b, 0x33, 0x15, 0x05, 0xb1, 0xd6, 0xaf);
    } // namespace follow_up_2

    //------------------------------------------------------------------------------
    namespace delay_request_1
    {
        // from PTP_clock.pcap
        constexpr auto sequence_id              = 27943;
        constexpr auto precise_origin_timestamp = ts80(1486566164, 970495939);
        constexpr auto data =
            to_byte_array(0x01, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x70, 0xff, 0xfe, 0x00, 0x21, 0x86, 0x00, 0x01,
                          0x6d, 0x27, 0x01, 0x7f, 0x00, 0x00, 0x58, 0x9b, 0x33, 0x14, 0x39, 0xd8, 0x97, 0xc3);
    } // namespace delay_request_1

    namespace delay_request_2
    {
        // from PTP_clock.pcap
        constexpr auto sequence_id              = 27944;
        constexpr auto precise_origin_timestamp = ts80(1486566165, 95541000);
        constexpr auto data =
            to_byte_array(0x01, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x70, 0xff, 0xfe, 0x00, 0x21, 0x86, 0x00, 0x01,
                          0x6d, 0x28, 0x01, 0x7f, 0x00, 0x00, 0x58, 0x9b, 0x33, 0x15, 0x05, 0xb1, 0xd7, 0x08);
    } // namespace delay_request_2

    //------------------------------------------------------------------------------
    namespace delay_response_1
    {
        // from PTP_clock.pcap
        constexpr auto sequence_id       = 27943;
        constexpr auto receive_timestamp = ts80(1486566164, 991046753);
        constexpr auto requesting_port_identity =
            to_byte_array(0x00, 0x23, 0x70, 0xff, 0xfe, 0x00, 0x21, 0x86, 0x00, 0x01);
        constexpr auto data = to_byte_array(
            0x09, 0x02, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
            0x00, 0x00, 0x28, 0x99, 0x3a, 0xff, 0xff, 0x26, 0x7e, 0x2b, 0x00, 0x14, 0x6d, 0x27, 0x03, 0xfd, 0x00, 0x00,
            0x58, 0x9b, 0x33, 0x14, 0x3b, 0x12, 0x2c, 0x61, 0x00, 0x23, 0x70, 0xff, 0xfe, 0x00, 0x21, 0x86, 0x00, 0x01);
    } // namespace delay_response_1

    namespace delay_response_2
    {
        // from PTP_clock.pcap
        constexpr auto sequence_id       = 27944;
        constexpr auto receive_timestamp = ts80(1486566165, 118026563);
        constexpr auto requesting_port_identity =
            to_byte_array(0x00, 0x23, 0x70, 0xff, 0xfe, 0x00, 0x21, 0x86, 0x00, 0x01);
        constexpr auto data = to_byte_array(
            0x09, 0x02, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
            0x00, 0x00, 0x28, 0x99, 0x3a, 0xff, 0xff, 0x26, 0x7e, 0x2b, 0x00, 0x14, 0x6d, 0x28, 0x03, 0xfd, 0x00, 0x00,
            0x58, 0x9b, 0x33, 0x15, 0x07, 0x08, 0xf1, 0x43, 0x00, 0x23, 0x70, 0xff, 0xfe, 0x00, 0x21, 0x86, 0x00, 0x01);
    } // namespace delay_response_2
} // namespace ebu_list::ptp::v2::test
